package com.robot.base.common.api;

import com.qihang.annotations.ApiFactory;
import com.robot.base.model.CourseAllTypeBean;
import com.robot.base.model.CustomerItemInfo;
import com.robot.base.model.HomeProjectBean;
import com.robot.base.model.PageListBean;
import com.robot.base.model.ProjectBean;
import com.robot.base.model.ProjectDetailBean;

import java.util.List;
import java.util.Map;

import io.reactivex.Observable;
import me.goldze.mvvmhabit.http.BaseResponse;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;
import retrofit2.http.QueryMap;

@ApiFactory(value = GlBaseApi.class)
public interface ProjectService {

    @GET("/app-api/app/consts/allType")
    Observable<BaseResponse<List<CourseAllTypeBean>>> allType();

    @GET("app-api/app/consts/homeDate")
    Observable<BaseResponse<HomeProjectBean>> homeDate();

    @GET("app-api/app/consts/casePage")
    Observable<BaseResponse<PageListBean<ProjectBean>>> casePage(@QueryMap Map<String, Object> map);

    @GET("/app-api/app/consts/getCase")
    Observable<BaseResponse<ProjectBean>> getCase(@Query("id") String id);

    @POST("app-api/app/consts/createConsts")
    Observable<BaseResponse<String>> createConsts(@Body Map<String, Object> map);

    /**
     * 查询个人项目
     *
     * @param map status 0审核中，1：待启动，2：已付款，3：开发中，4：已完成，5，已结算，6：审核拒绝
     * @return
     */
    @GET("app-api/app/consts/getAccountItemInfo")
    Observable<BaseResponse<PageListBean<CustomerItemInfo>>> getCustomerItemInfo(@QueryMap Map<String, Object> map);

    @GET("/app-api/app/consts/get")
    Observable<BaseResponse<ProjectDetailBean>> getProjectDetail(@Query("id") String id);
}
